dir=getDirectory("Select a directory");//Set directory to save files into
run("Mitosis (5D stack)") ;//Open mitosis image
run("Z Project...", "projection=[Max Intensity] all") ;//Maximum intensity projection to remove z-dimension
run("Duplicate...", "duplicate frames=25-28") ;//Duplicate only frames 25-28 of the image
run("RGB Color", "frames") ;//Convert image to RGB
run("Stack to Images") ;//Separate stack to individual RGB images for each timeframe
selectWindow("MAX_mitosis-1-0001") ;//Select the first image separated from the stack
run("Scale Bar...", "width=5 height=7 thickness=2 font=14 color=White background=None location=[Lower Right] horizontal bold hide overlay");//Add scale bar
run("Flatten") ;//Stamp scale bar on image
close("mitosis.tif") ;close("MAX_mitosis.tif") ;close("MAX_mitosis-1-0001") ; //close unwanted images
selectWindow("MAX_mitosis-1-0001-1");//Select image 1
saveAs("tiff", dir+"Img_1.tif");//Save image into chosen directory by making a path combining the directory address with a new file name
close("Img_1.tif");//Close the image. NB it's name has changed, so this new name needs to be used to close it
selectWindow("MAX_mitosis-1-0002");//This script will open the stock image "mitosis (5D stack)" and process it to make images for a figure
//Add code to save and close this image
selectWindow("MAX_mitosis-1-0003");
//Add code to save and close this image
selectWindow("MAX_mitosis-1-0004");
//Add code to save and close this image